<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="com.pervasive.container.*" %>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.pervasive.project.unified.data.constants.Constants" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
		<h2 style="text-align: center;"><span style="font-size:18px;"><span style="font-family: arial, helvetica, sans-serif;">Picture Comparisons and Scores&nbsp;</span></span></h2>
		<%
		HashMap<String, Map<Constants.cardId, ContainerStruc>> userDataMap = (HashMap<String, Map<Constants.cardId, ContainerStruc>>)request.getAttribute("Results");
		%>
		
		<%
		Iterator<String> users = userDataMap.keySet().iterator();
		%>
		
		<%
		while(users.hasNext())
		{
			String user = users.next();
			Iterator<Constants.cardId> cardIdIte = userDataMap.get(user).keySet().iterator();
		%>
		
	    <TABLE BORDER="5"    WIDTH="50%"   CELLPADDING="4" CELLSPACING="3" ALIGN="CENTER" id="scoretable">
			
			<TR align="left">
			
			</TR>
			<TD bordercolor="#99CCFF" colspan="50%" ><%=user%></TD>
				<TR>
			<TH>Question Images</TH>
			<TH>Answer Images</TH>
			<TH>Score</TH>
			</TR>
			<%
			int totalScore = 0;
			while(cardIdIte.hasNext())
			{
				Constants.cardId cardId = cardIdIte.next();
				String pixName = userDataMap.get(user).get(cardId).getPixName();
				int score = userDataMap.get(user).get(cardId).getScore();
				totalScore += score;
			%>
			<TR ALIGN="CENTER">
				<TD><img src="/services/images/cards/<%=cardId.toString().toLowerCase()%>.png" height="300" width="200"></TD> <!-- Put the Card Image Here -->
				<TD><img src="/services/images/snaps/<%=pixName%>" height="300" width="200"></TD> <!-- Put the Pix Image Here -->
				<TD><%=score%></TD> <!-- Put the score here -->
			</TR>
			<%
			}
			%>
			<TR ALIGN="CENTER">
				<TD colspan="2"><p>Total ScoreScore</p></TD> 
				<TD colspan="1"><%=totalScore%></TD> 
			</TR>
		</TABLE>
	    <p>&nbsp;</p>
	    <p>&nbsp;</p>
	    
	    <%
		}
	    %>
		
		<!-- 
		<TABLE BORDER="5"    WIDTH="50%"   CELLPADDING="4" CELLSPACING="3" ALIGN="CENTER" id="scoretable">
			
			<TR align="left">
			
			</TR>
			<TD bordercolor="#99CCFF" colspan="50%" >PLAYER2</TD>
				<TR>
			<TH>Question Images</TH>
			<TH>Answer Images</TH>
			<TH>Score</TH>
			</TR>
			<TR ALIGN="CENTER">
				<TD><img src="g1q1.png"></TD>
				<TD>Data 2</TD>
				<TD>Data 2</TD>
			</TR>
		</TABLE>
		 -->
</body>
</html>
